/*
 * @描述: 
 * @创建者: kilomChou
 * @Date: 2021-04-11 16:44:37
 * @最后编辑: kilomChou
 * @LastEditTime: 2021-05-06 08:49:19
 */

import { ProtoVo } from "../../data/Proto";
import ProtoDispatcher from "./ProtoDispatcher";

export default interface IConn {

    /** 协议派发器 */
    readonly PD: ProtoDispatcher
    /** 连接id */
    id: number

    /** 监听协议 */
    on<Proto extends keyof ProtoVo.Def>(proto: Proto, cb: (data: ProtoVo.Def[Proto]) => any): void
    /** 接收到协议 */
    onMsg<Proto extends keyof ProtoVo.Def>(proto: Proto, data?: ProtoVo.Def[Proto]): void
    /** 发送协议 */
    send<Proto extends keyof ProtoVo.Def>(proto: Proto, data?: ProtoVo.Def[Proto]): void

}